package com.wcarmon.life.business {

    import com.adobe.cairngorm.business.ServiceLocator;
    import com.adobe.cairngorm.business.IServiceLocator;
    import com.adobe.cairngorm.commands.ICommand
    import com.adobe.cairngorm.control.CairngormEvent;

    import com.wcarmon.life.vo.BlockVO;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.IResponder;
	import flash.utils.*;
	

	public class SaveBlockFieldDelegate {
		include "../../includes/loggerSnippet.as";	

		private var responder : IResponder;
		private var service : Object;

		public function SaveBlockFieldDelegate( responder : IResponder ){
			this.service = ServiceLocator.getInstance().getRemoteObject("LifeOrganizeService");
			this.responder = responder;
			log.info( 'Using this php file: ' + this.service.source );
		}
		public function saveBlockField( block_id:uint, theField:String, theValue:* ) : void {
			log.info("saving field for block #" + block_id);
			log.debug( "block_id=" + block_id + ", theField=" + theField + ", theValue=" + theValue);
			var call : Object = service.saveBlockField( block_id, theField, theValue );
			call.addResponder( responder );
		}
	}
}